﻿namespace WMS6.Web.Administration
{
    using System;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class CustomizedPageQuery : BasePage
    {
        protected Button btnExport;
        protected Button btnList;
        protected Button btnSearch;
        protected DropDownList ddlFunctionGroupNameOper;
        protected DropDownList ddlFunctionIDOper;
        protected DropDownList ddlFunctionNameOper;
        protected DropDownList ddlGridviewIDOper;
        protected DropDownList ddlHeaderTextOper;
        protected HtmlForm F15050;
        protected Label lblCusotmizedPage;
        protected Label lblFunctionGroupName;
        protected Label lblFunctionID;
        protected Label lblFunctionName;
        protected Label lblGridviewID;
        protected Label lblHeaderText;
        protected HtmlLink mycss;
        protected TextBox txtFunctionGroupName;
        protected TextBox txtFunctionID;
        protected TextBox txtFunctionName;
        protected TextBox txtGridviewID;
        protected TextBox txtHeaderText;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("CustomizedPageList.aspx", false);
        }

        private void LoadDDL()
        {
            base.InitQueryDDL(this.ddlFunctionIDOper, 0);
            base.InitQueryDDL(this.ddlGridviewIDOper, 0);
            base.InitQueryDDL(this.ddlHeaderTextOper, 0);
            base.InitQueryDDL(this.ddlFunctionNameOper, 0);
            base.InitQueryDDL(this.ddlFunctionGroupNameOper, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDL();
            }
        }

        public string FunctionGroupName
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFunctionGroupName.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFunctionGroupName.Text.Trim(), this.ddlFunctionGroupNameOper.SelectedValue);
                }
                return "";
            }
        }

        public string FunctionID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFunctionID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFunctionID.Text.Trim(), this.ddlFunctionIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string FunctionName
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtFunctionName.Text.Trim()))
                {
                    return base.GetParamsString(this.txtFunctionName.Text.Trim(), this.ddlFunctionNameOper.SelectedValue);
                }
                return "";
            }
        }

        public string GridviewID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtGridviewID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtGridviewID.Text.Trim(), this.ddlGridviewIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string HeaderText
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtHeaderText.Text.Trim()))
                {
                    return base.GetParamsString(this.txtHeaderText.Text.Trim(), this.ddlHeaderTextOper.SelectedValue);
                }
                return "";
            }
        }
    }
}

